package cn.edu.hcnu.service;

import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Service;

/**
 * @ClassName SendMessageService
 * @Description TODO
 * @Author liang
 * @Date 2023/6/14 15:05
 * @Version 1.0
 **/

@Service
public class SendMessageService {
    @RabbitListener(
            bindings = @QueueBinding(
                    value = @Queue("2020101856exchange_queue"),
                    exchange = @Exchange(
                            value = "2020101856exchange_topic",
                            type = "topic"),
                    key = "2020101856routing_topic")
            )
    public void sendMessage(String message) {
        System.out.println("收到登录成功之后的消息："+message);
    }
}
